// component/bar/bar.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        active:""
    },

    /**
     * 组件的初始数据
     */
    data: {
        list:[{
            name:"首页",
            type:"text",
            address:"index"
        },
        {
            name:"检测",
            type:"text",
            address:"testing"
        },
        {
            name:"我的",
            type:"text",
            address:"my"
        },
    ],
    select:0
    },

    /**
     * 组件的方法列表
     */
    methods: {
      onChange(e) {
          let index = e.currentTarget.dataset.index
        //转跳
        let address = this.data.list[index].address
        console.log(index)
        wx.switchTab({
          url: "../"+address+"/"+address
        })
      },
    }
})
